package redis;

import redis.clients.jedis.Jedis;

/**
 * @author sjw
 * @description
 * @date 2019-09-30 上午10:14
 */
public class Publish {
    public static void main(String[] args) {
        String host="192.168.10.66";
        host="123.57.233.10";

        Jedis jedis = new Jedis(host, 6379);
        //String res= jedis.set("2","1","NX","EX",10);
//        System.out.println(res);
        //String value = jedis.get("2");
        //System.out.println(value);
        int I=256*1024*1024;
        I=2682230;
        //jedis.set("test","a");
//        StringBuilder stringBuilder=new StringBuilder(I);
//        //char[] chars=new char[I];
        for(int i=0;i<I;i++){
            System.out.println(i);
            jedis.append("test","aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        }
//        //System.out.println(stringBuilder.toString());
//        System.out.println(stringBuilder.length());
//        jedis.set("1",stringBuilder.toString());
        //jedis.h
        //jedis.close();
        //Long l= jedis.publish("sjw", "sjw");
        //System.out.println(l);
//        jedis.subscribe(new SubscribeClient(), "sjw1");
    }
// 319846

}
